package com.qfedu.meidijiaju.controller;


import com.qfedu.meidijiaju.entity.BxXh;
import com.qfedu.meidijiaju.entity.KongTiaoXh;
import com.qfedu.meidijiaju.entity.ResponseData;
import com.qfedu.meidijiaju.service.BxXhService;
import com.qfedu.meidijiaju.service.KongTiaoXhService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "空调型号查询模块接口")
@RestController
public class KontTiaoXhController {
    @Autowired
    private KongTiaoXhService kongTiaoXhService;

    @ApiOperation("查询空调型号")
    @RequestMapping(value = "/KongTiaoXh/queryKongTiaoXh",method = RequestMethod.GET)
    public ResponseData<List<KongTiaoXh>> queryKongTiaoXh() {
        ResponseData<List<KongTiaoXh>> responseData = new ResponseData<>();
        List<KongTiaoXh> result = kongTiaoXhService.queryKongTiaoXh();
        int count = kongTiaoXhService.queryCount();
        if (result != null) {
            responseData.setCode(0);
            responseData.setData(result);
            responseData.setCount(count);
        }
        return responseData;
    }
}
